package com.tianyin.dao.impl;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import com.tianyin.entity.User;



@Repository
public class UserDaoImpl  {

	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@Autowired
	private HibernateTemplate hibernateTemplate;
	
	
	 public int findUser(){
		 String sql="select count(*) from T_USER";
		 int count=jdbcTemplate.queryForInt(sql);
		 return count;
	 }
	 
	 public void saveLogin(){
		 User u=new User();
		 u.setAccount("123");
		 u.setPassword("234");
		 u.setId(18);
		 hibernateTemplate.save(u);
	 }
}
